package com.hunan.api.catv.service.impl.member;

import com.hunan.api.catv.dao.BaseDao;
import com.hunan.api.catv.dao.MemberDao;
import com.hunan.api.catv.entity.po.Member;
import com.hunan.api.catv.entity.vo.MemberVo;
import com.hunan.api.catv.service.impl.CommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Service
public class MemberService extends CommonService<Member, MemberVo, Integer> {
    @Autowired
    public MemberDao memberDao;

    @Override
    public BaseDao<Member, MemberVo, Integer> getBaseDao() {
        return memberDao;
    }

    public Map<String, Object> inviterCount(Integer memberId) {
        return memberDao.inviterCount(memberId);
    }

    public List<MemberVo> inviterList(Integer memberId) {
        return memberDao.inviterList(memberId);
    }

    public List<MemberVo> inviterListByRegTime(Integer memberId, String regTime, LocalDateTime startDateTime, LocalDateTime endDateTime) {
        return memberDao.inviterListByRegTime(memberId, regTime, startDateTime, endDateTime);
    }

    public Integer getInviterByMemberId(Integer memberId) {
        return memberDao.getInviterByMemberId(memberId);
    }

    public MemberVo getByPhone(String phone) {
        return memberDao.getByPhone(phone);
    }
}
